
using System;
using System.Drawing;

using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.ObjCRuntime;

namespace bjeschool
{
	public partial class CourseEdit : UIViewController
	{

		[Action("SelectGroupLongClick:")]
		private void SelectGroupLongClick (UIButton sender)
		{
			//			var menu = UIMenuController.SharedMenuController;
			//			menu.MenuItems = new UIMenuItem[] {
			//				new UIMenuItem ("Current", new Selector ("SortRaceEntrants")),
			//				new UIMenuItem ("Movers", new Selector ("SortRaceEntrants")),
			//				new UIMenuItem ("Opening", new Selector ("SortRaceEntrants")),
			//				new UIMenuItem ("Number", new Selector ("SortRaceEntrants"))
			//			};
			//			menu.SetTargetRect (sender.Frame, this.View);
			//			menu.SetMenuVisible (true, true);
			
			var menuController = UIMenuController.SharedMenuController;
			var resetMenuItem = new UIMenuItem ("Reset", new Selector ("ResetImage"));
			BecomeFirstResponder ();
			menuController.MenuItems = new [] { resetMenuItem };
			RectangleF rect = sender.Frame;
			rect.Width = 200;
			rect.Height = 100;
			menuController.SetTargetRect (rect, this.View);
			menuController.MenuVisible = true;
			//				menuController.Animated = true;
		}

		[Export("ResetImage")]
		void ResetImage (UIMenuController controller)
		{
			int i = 0;
		}

		public CourseEdit () : base ("CourseEdit", null)
		{
		}
		
		public override void DidReceiveMemoryWarning ()
		{
			// Releases the view if it doesn't have a superview.
			base.DidReceiveMemoryWarning ();
			
			// Release any cached data, images, etc that aren't in use.
		}
		
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			// Perform any additional setup after loading the view, typically from a nib.
		}
		
		public override void ViewDidUnload ()
		{
			base.ViewDidUnload ();
			
			// Clear any references to subviews of the main view in order to
			// allow the Garbage Collector to collect them sooner.
			//
			// e.g. myOutlet.Dispose (); myOutlet = null;
			
			ReleaseDesignerOutlets ();
		}
		
		public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
		{
			// Return true for supported orientations
			return true;
		}
	}
}

